package com.blb.suanfa;

import java.util.LinkedList;
import java.util.Queue;

public class QueueDemo {

    public static void main(String[] args) {
        //创建队列
        Queue<String> queue = new LinkedList<>();
        //入队
        queue.add("张飞");
        queue.add("关羽");
        queue.add("刘备");
        queue.add("赵云");
        queue.offer("黄忠");
        //出队
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.poll());
        System.out.println(queue.remove());
        System.out.println(queue.remove());
        System.out.println(queue.remove());
    }
}
